home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-09-27 | 52.7 KB | 1,626 lines |
- Newsgroups: comp.sources.misc
- From: steve@robobar.co.uk (Steve Bleazard)
- Subject: v23i028: xenix-gnu - Xenix 386 patchkit for GCC / GAS and GDB, Part01/03
- Message-ID: <csm-v23i028=xenix-gnu.235700@sparky.IMD.Sterling.COM>
- X-Md4-Signature: 2c8ce197d6aed83417b22bd85b9bfbab
- Date: Fri, 27 Sep 1991 04:59:23 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: steve@robobar.co.uk (Steve Bleazard)
- Posting-number: Volume 23, Issue 28
- Archive-name: xenix-gnu/part01
- Environment: SCOXENIX
-
- This is part 1 of a 3 part posting.
-
- This and the following 2 parts consists of patch kits to GCC 1.40,
- GAS 1.38.1 and GDB 3.5 for SCO Xenix 386. The port was done by Steve Bleazard
- <steve@robobar.co.uk> with assistance from Ronald Khoo <ronald@ibmpcug.co.uk>.
- Please see the file README.GCC for more information.
-
- The patches to GCC, GAS and GDB are all covered by the GNU Public
- Licence, please refer to COPYING in the source to any of these programs.
- Richard Stallman has ask me to remind you that if you wish to distribute
- the binaries to any of the programs produced using these patches you
- must also make a *complete* source distribution available.
-
- Steve.Bleazard@RoboBar.Co.Uk
- ------
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: README.GCC gcc-1.40.pch
- # Wrapped by kent@sparky on Thu Sep 26 23:47:58 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive."'
- if test -f 'README.GCC' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README.GCC'\"
- else
- echo shar: Extracting \"'README.GCC'\" \(8239 characters\)
- sed "s/^X//" >'README.GCC' <<'END_OF_FILE'
- X# @(#) $Id: README.GCC,v 1.2 1991/08/22 20:02:56 ronald Exp $
- X
- XThis README describes the port of GNU CC to SCO XENIX 386 from RoboBar Ltd.
- XThis port consists of patch kits to GCC 1.40, GAS 1.38.1 and GDB 3.5
- XThe port was done by Steve Bleazard <steve@robobar.co.uk> with assistance
- Xfrom Ronald Khoo <ronald@ibmpcug.co.uk> who wrote this README and packaged
- Xthe kit.
- X
- XDisclaimer: RoboBar Ltd has no connection with the Santa Cruz Operation
- X whatsoever, other than being an indirect customer of theirs.
- X There is no warranty, nor claim of fitness for any purpose of
- X any program code you may happen to find in these files.
- X Various trademarks of Intel Corp, Microsoft Corp, and the
- X Santa Cruz Operation, Inc. are mentioned in these files,
- X and are hereby acknowledged.
- X
- X(C) Copyright 1991 RoboBar Ltd. Permission is granted to redistribute
- X this article without any encumbrance, other than that this copyright
- X notice be retained, and that any modifications be clearly marked as such.
- X
- XOverview:
- X
- XThis port works on SCO XENIX 386. It has been tested on:
- X OS version: 2.3.4 with Development System version 2.3.1b
- Xbut we believe that it should be useable with some effort on versions
- X2.2 and later.
- X
- XThe object file format used is the native Microsoft/Intel OMF format,
- X so the GNU binutils are not used. Therefore, this port is
- X compatible with third party SCO-compatible object libraries.
- XThe SCO Development System provides the system libraries and include files.
- XThe standard Microsoft assembler is not used -- instead the GNU assembler
- X was ported to produce OMF.
- XA linker helper-program (provided by Christoph Badura <bad@flatlin.ka.sub.org>,
- X installed as /usr/local/lib/gcc-ld) helps gcc's -L -l options to work.
- X However, the standard XENIX /bin/ld does the real linking--it
- X is executed by Christoph's program.
- XSymbolic debugging is supported for the accompanying port of GDB only.
- X SCO's sdb debugging format is not documented, and seems to change
- X from release to release, so we can't support it.
- XThe port of GDB was started from an sdb-based port by rdk386!ron (Ron Kuris)
- X Without his lead, this port would probably not exist.
- XThe GNU compiler system, as modified by these patches, serves as our
- X production compiler at RoboBar. We believe it to be of
- X production quality, and in any case of much higher quality than
- X SCO XENIX's native Microsoft compiler system.
- X
- XThis README documents how to compile and install this GCC port from
- Xthe patches alone. You can skip some of the steps if you already
- Xhave XENIX GCC binaries from earlier versions of this XENIX GCC port.
- XIf you are building from scratch, you can use the commands indicated
- Xby => in this README as a guide. On *our* system, those commands
- Xwere directly executed from this file via a script. If your version
- Xof XENIX or the Development System is different from ours, you may
- Xhave to hack a bit, though.
- X
- XNote that parts of the procedure require you to be root, with a umask no
- Xmore paranoid than 022.
- X
- XWhat you need:
- X
- X SCO XENIX 386 Operating System
- X SCO XENIX 386 Development System
- X Larry Wall's "patch" program, version 2, patchlevel 12.
- X (from volume 7 of comp.sources.unix, or the GNU
- X enhanced one from prep.ai.mit.edu)
- X The standard GNU distributions of the compiler and assembler:
- X gcc-1.40.tar.Z and gas-1.38.1.tar.Z
- X (from prep.ai.mit.edu:/pub/gnu)
- X The three patches in this kit:
- X gcc-1.40.pch
- X gas-1.38.pch
- X gdb-3.5b.pch
- X A modicum of free disc space. 10 Mb is comfortable. You can
- X do it with less, but the instructions here assume 10Mb free.
- X
- X Patience. Lots of patience. The patience of a saint.
- X
- XWhat to do:
- X
- X First, ensure /usr/local/bin is in your PATH, and that
- X the "patch" program can be found in your path.
- X=> PATH=/usr/local/bin:/bin:/usr/bin export PATH
- X
- X Next, unpack the GNU distributions, and copy alloca.c from
- X the GCC directory into the GAS directory:
- X
- X=> zcat < gas-1.38.1.tar.Z | tar xf -
- X=> zcat < gcc-1.40.tar.Z | tar xf -
- X=> zcat < gdb-3.5.tar.Z | tar xf -
- X=> cp gcc-1.40/alloca.c gas-1.38/alloca.c
- X
- X Now, compile the GNU assembler with the standard compiler.
- X (Do not switch the optimiser on, as this will cause
- X incorrect code to be generated. And "const" breaks it)
- X=> cd gas-1.38
- X=> patch < ../gas-1.38.pch
- X=> cc -c alloca.c
- X=> make ax386 G0="-Dconst= -DUSG -DWORKING_DOT_WORD" O1= LOADLIBES=alloca.o
- X
- X (Throughout this build, you will get plenty of warning messages
- X from the compiler. At this stage, it is best to ignore them)
- X
- X Now, install the assembler as /usr/local/lib/gcc-as
- X
- X=> mkdir /usr/local ; mkdir /usr/local/lib ; mkdir /usr/local/bin
- X=> cp ax386 /usr/local/lib/gcc-as
- X
- X Now, you need to make minimal necessary changes to your
- X system include files and then build gcc itself.
- X You may have to modify fixmin.xenix depending on your version
- X of the Operating and Development systems. Sigh.
- X
- X=> cd ../gcc-1.40
- X=> patch -p < ../gcc-1.40.pch
- X=> sh fixmin.xenix # have to be root to do this!
- X=> sh config.gcc xenix386
- X
- X Compile gcc for the first time using the Microsoft compiler:
- X
- X=> make -f Makefile.msc -f Makefile msc ALLOCA=alloca.o CFLAGS=
- X
- X (This build may fail somewhere and core dump near the end when
- X it tries to build gnulib2. Ignore it, it doesn't matter)
- X
- X Save this version of gcc, then make gcc with this saved version.
- X
- X=> make stage1
- X=> make CC=stage1/gcc CFLAGS=-Bstage1/ # cannot optimise yet
- X
- X Now we can build an optimised version of gcc.
- X
- X=> make stage2
- X=> rm -rf stage1 # regain some disc space if you're short of it.
- X=> make CC=stage2/gcc CFLAGS="-Bstage2/ -O"
- X
- X At this point, we have a correctly compiled version of gcc.
- X We now install it, then go and recompile gas with gcc
- X
- X=> make install INSTALL=cp
- X=> cd ../gas-1.38
- X=> rm -f *.o ax386
- X=> make ax386 G0="-O -DUSG -DWORKING_DOT_WORD" O1= LOADLIBES= CC=gcc
- X=> cp ax386 /usr/local/lib/gcc-as
- X=> rm -f /usr/local/bin/gas
- X=> ln /usr/local/lib/gcc-as /usr/local/bin/gas
- X
- X Finally, we compile gcc again, using a correctly built gas.
- X
- X=> cd ../gcc-1.40
- X=> make stage3
- X=> rm -rf stage2 # regain some disc space if you're short of it.
- X=> make CC=stage3/gcc CFLAGS="-Bstage3/ -O"
- X
- X In fact, if we're lucky, this version should be identical to
- X the previous version, and if it is, we're happy. So let's check.
- X
- X=> for i in *.o ; do cmp -s $i stage3/$i || echo $i broke ; done
- X
- X (Hopefully none should break, if any do, you will have to iterate
- X through more stage builds of both gcc and gas until it no longer
- X breaks)
- X
- X Now, we install Christopher's ld helper program so that
- X gcc's -l and -L options will work:
- X
- X=> gcc -O -Iconfig xenixld.c -o gcc-ld
- X=> cp gcc-ld /usr/local/lib/gcc-ld
- X
- X Now, it's probably wise to undo the damage we did to /usr/include
- X
- X=> sh fixmin.xenix undo
- X
- X However, the include files are really not in a useable state.
- X You will have to hack them a lot, but the fix.h.xenix file contains
- X a few useful hints. But *PLEASE* read it before you execute it,
- X as it may well need customising for your site. In particular,
- X if you've done stuff like adding #ifdef _SIZE_T to your include files,
- X the script may not work anymore. But the __M_I386__ hack in there
- X must be done, or else you won't be able to use gcc -ansi.
- X
- X=> sh fix.h.xenix
- X
- X I guess a debugger is useful to have so let's build that:
- X
- X=> cd ../dist-gdb
- X=> patch -p < ../gdb-3.5b.pch
- X=> sh config.gdb xenix386
- X
- X Depending on the version of your Development System libraries,
- X you may have to edit m-xenix386.h at this point to #define
- X the symbol PTRACE_ADDR_ARG_STRUCT. This is necessary for version 2.2,
- X but not for 2.3 (the default).
- X
- X=> make CC=gcc GLOBAL_CFLAGS="-O -I. -traditional -DNO_PROTOTYPE"
- X=> mv gdb /usr/local/bin
- X
- X There's a helper module that's useful for use with GDB.
- X Read the source file gdbspace.asm for more info.
- X (/usr/lib/storel is part of your XENIX link kit).
- X=> /usr/lib/storel gdbspace.asm && mv gdbspace.o /usr/local/lib/libgdb.a
- X
- X Then it's probably time for a long beer. Of course, Murphy's
- X Law states that your disc controller will probably die,
- X destroying your disc in the process just at this point ....
- X
- XIf you come across any XENIX-related GCC problems, please send mail to
- XSteve Bleazard <steve@robobar.co.uk> or uunet!mcsun!ukc!robobar!steve
- END_OF_FILE
- if test 8239 -ne `wc -c <'README.GCC'`; then
- echo shar: \"'README.GCC'\" unpacked with wrong size!
- fi
- # end of 'README.GCC'
- fi
- if test -f 'gcc-1.40.pch' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'gcc-1.40.pch'\"
- else
- echo shar: Extracting \"'gcc-1.40.pch'\" \(41132 characters\)
- sed "s/^X//" >'gcc-1.40.pch' <<'END_OF_FILE'
- X*** gcc-1.40/Makefile Mon Jul 29 13:15:49 1991
- X--- Makefile Mon Jul 29 13:45:38 1991
- X***************
- X*** 157,162 ****
- X--- 157,167 ----
- X # HARD_PARAMS_FLAGS= -Anansi
- X # (Says vasta@apollo.com.)
- X
- X+ # To compile GCC with Microsoft CC use the following CFLAGS and then
- X+ # 'make msc'. Note that the resultant cc1 CANNOT compile with optimization
- X+ # switched on, ie stage 2 should not have '-O' in CFLAGS
- X+ CFLAGS = -g $(XCFLAGS)
- X+ PRAGMA=pragmapack.o
- X
- X # Dependency on obstack, alloca, malloc or whatever library facilities
- X # are not installed in the system libraries.
- X***************
- X*** 192,198 ****
- X symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \
- X integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
- X regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \
- X! insn-peep.o final.o recog.o insn-recog.o insn-extract.o insn-output.o
- X
- X # Files to be copied away after each stage in building.
- X STAGE_GCC=gcc
- X--- 197,203 ----
- X symout.o dbxout.o sdbout.o emit-rtl.o insn-emit.o \
- X integrate.o jump.o cse.o loop.o flow.o stupid.o combine.o \
- X regclass.o local-alloc.o global-alloc.o reload.o reload1.o caller-save.o \
- X! insn-peep.o final.o recog.o insn-recog.o insn-extract.o insn-output.o $(PRAGMA)
- X
- X # Files to be copied away after each stage in building.
- X STAGE_GCC=gcc
- X***************
- X*** 239,244 ****
- X--- 244,257 ----
- X # is include the system varargs.h.
- X
- X all: config.status gnulib gcc cc1 cpp float.h gnulib2 # cc1plus
- X+ msc: config.status gnulib cc1 cpp float.h gcc.msc gnulib2 # cc1plus
- X+
- X+ gcc.msc: cc1 cpp version.o $(LIBDEPS)
- X+ ./cpp -I/usr/include $(CPPFLAGS) $(INCLUDES) gcc.c > tmpgcc.i
- X+ -./cc1 -quiet $(CFLAGS) -o tmpgcc.s tmpgcc.i
- X+ /usr/local/lib/gcc-as -o gcc.o tmpgcc.s
- X+ rm -f tmpgcc.s
- X+ $(CC) $(CFLAGS) $(LDFLAGS) -o gcc gcc.o version.o $(LIBS)
- X
- X # Use this instead of `all' if you need to convert the libraries
- X # before you can use the compiler.
- X***************
- X*** 433,440 ****
- X # from the GNU Emacs distribution.
- X # Note some machines won't allow $(CC) without -S on this source file.
- X alloca.o: alloca.c
- X! $(CC) $(CFLAGS) -S `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
- X! as alloca.s -o alloca.o
- X
- X # Now the source files that are generated from the machine description.
- X
- X--- 446,452 ----
- X # from the GNU Emacs distribution.
- X # Note some machines won't allow $(CC) without -S on this source file.
- X alloca.o: alloca.c
- X! $(CC) $(CFLAGS) -c `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
- X
- X # Now the source files that are generated from the machine description.
- X
- X*** gcc-1.40/Makefile.msc
- X--- Makefile.msc Wed Jul 10 16:36:39 1991
- X***************
- X*** 0 ****
- X--- 1,22 ----
- X+ # Microsoft C 5.1's built in cpp does not grok the large macros.
- X+ # Therefore use the AT&T cpp instead for the files that fail.
- X+ # Use this command line:
- X+ # make -f Makefile -f Makefile.msc msc ALLOCA=alloca.o
- X+
- X+ explow.o: explow.c
- X+ /lib/cpp -P ${INCLUDES} explow.c >explow.i
- X+ mv explow.i x.c
- X+ cc ${CFLAGS} -c x.c
- X+ mv x.o explow.o
- X+
- X+ reload.o: reload.c
- X+ /lib/cpp -P ${INCLUDES} reload.c >reload.i
- X+ mv reload.i x.c
- X+ cc ${CFLAGS} -c x.c
- X+ mv x.o reload.o
- X+
- X+ recog.o: recog.c
- X+ /lib/cpp -P ${INCLUDES} recog.c >recog.i
- X+ mv recog.i x.c
- X+ cc ${CFLAGS} -c x.c
- X+ mv x.o recog.o
- X*** gcc-1.40/c-parse.y Mon Jul 29 13:15:54 1991
- X--- c-parse.y Wed Jul 10 15:56:21 1991
- X***************
- X*** 1803,1808 ****
- X--- 1803,1849 ----
- X && getc (finput) == 'm'
- X && getc (finput) == 'a'
- X && ((c = getc (finput)) == ' ' || c == '\t' || c == '\n'))
- X+ #ifdef PRAGMA_PACK
- X+ {
- X+ token = yylex();
- X+ if (token != IDENTIFIER)
- X+ goto skipline;
- X+
- X+ if (strcmp(token_buffer, "pack") != 0)
- X+ goto skipline;
- X+
- X+ token = yylex();
- X+ if (token != '(') {
- X+ error ("invalid #pragma pack expecting '('");
- X+ goto skipline;
- X+ }
- X+
- X+ /* setup default alignment first */
- X+
- X+ pragma_pack_default();
- X+
- X+ token = yylex();
- X+ if (token != ')')
- X+ {
- X+ if (token == CONSTANT
- X+ && TREE_CODE (yylval.ttype) == INTEGER_CST) {
- X+ int l = TREE_INT_CST_LOW (yylval.ttype);
- X+ pragma_pack(l);
- X+ }
- X+ else {
- X+ error ("invalid #pragma pack expecting 1, 2 or 4");
- X+ goto skipline;
- X+ }
- X+
- X+ token = yylex();
- X+ }
- X+
- X+ if (token != ')') {
- X+ error ("invalid #pragma pack expecting ')'");
- X+ goto skipline;
- X+ }
- X+ }
- X+ #endif
- X goto skipline;
- X }
- X
- X*** gcc-1.40/config/tm-xenix386.h
- X--- config/tm-xenix386.h Thu Aug 22 15:28:27 1991
- X***************
- X*** 0 ****
- X--- 1,146 ----
- X+ /* Definitions for Intel 386 running SCO XENIX 386.
- X+ Copyright (C) 1988 Free Software Foundation, Inc.
- X+
- X+ This file is part of GNU CC.
- X+
- X+ GNU CC is free software; you can redistribute it and/or modify
- X+ it under the terms of the GNU General Public License as published by
- X+ the Free Software Foundation; either version 1, or (at your option)
- X+ any later version.
- X+
- X+ GNU CC is distributed in the hope that it will be useful,
- X+ but WITHOUT ANY WARRANTY; without even the implied warranty of
- X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X+ GNU General Public License for more details.
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with GNU CC; see the file COPYING. If not, write to
- X+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+
- X+ #include "tm-i386.h"
- X+
- X+ /* Use the XENIX GAS assembler syntax. */
- X+
- X+ #include "tm-xgas386.h"
- X+
- X+ /* By default, target has a 80387 -- XENIX emulates it anyway */
- X+
- X+ #define TARGET_DEFAULT 1
- X+
- X+ /* Use crt1.o as a startup file and crtn.o as a closing file. */
- X+
- X+ #define STARTFILE_SPEC "Sseg.o%s %{!p:Scrt0.o%s} %{p:Smcrt0.o%s}"
- X+ #define STANDARD_STARTFILE_PREFIX_1 "/lib/386/"
- X+
- X+ /* -v is appropriate for use with GAS */
- X+
- X+ #define ASM_SPEC "%{v} %{g}"
- X+
- X+ #define LIB_SPEC "Slibcfp.a%s Slibc.a%s"
- X+
- X+ #define FULL_LINK_SPEC "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l %{g:-g} \
- X+ %{A} %{r} %{s} %{u*} \
- X+ %{!nostdlib:%S} %{L*} %{!o:-o a.out} %o %{!nostdlib:gnulib%s %L gnulib%s}\n \
- X+ }}}}";
- X+ #define LINK_SPEC "-i"
- X+
- X+ /* This is for use with G++. FASCIST_LDR is defined in G++'s Makefile */
- X+
- X+ #ifdef FASCIST_LDR
- X+
- X+ #define FULL_COLLECT_SPEC \
- X+ "%{!c:%{!M*:%{!E:%{!S:collect -o %g.S %g.R\n\
- X+ as %g.S -o %g.O\n\
- X+ ld %{o*} %{!o:-o a.out} %{!nostdlib:%S } %l %{g:-g} \
- X+ %{L*} %o %g.O %{!nostdlib:gnulib++%s gnulib%s %L } \n\
- X+ }}}}"
- X+
- X+ #define PLUS_FULL_LINK_SPEC \
- X+ "%{!c:%{!M*:%{!E:%{!S:ld -o %g.R \
- X+ %{!nostdlib:%S } %l %{g:-g}\
- X+ %{L*} %o %{!nostdlib:gnulib++%s gnulib%s g++dummy%s %L }\n }}}}";
- X+
- X+ #else /* not FASCIST_LDR */
- X+
- X+ #define FULL_COLLECT_SPEC \
- X+ "%{!c:%{!M*:%{!E:%{!S:collect -o %g.S %g.R\n\
- X+ as %g.S -o %g.O\n\
- X+ ld %{o*} %{!o:-o a.out} %{!nostdlib:%S } %g.R %g.O \
- X+ %{!nostdlib:gnulib++%s gnulib%s %L } \n\
- X+ }}}}"
- X+
- X+ #define PLUS_FULL_LINK_SPEC \
- X+ "%{!c:%{!M*:%{!E:%{!S:ld -r -o %g.R %l %{g:-g}\
- X+ %{L*} %o %{!nostdlib:%L }\n }}}}";
- X+
- X+ #endif /* not FASCIST_LDR */
- X+
- X+ /* Specify predefined symbols in preprocessor. */
- X+ /* You may wish to add -DM_INTERNAT, depending on your libraries. */
- X+
- X+ #define CPP_PREDEFINES "-Dunix \
- X+ -DM_I86 -DM_I86SM -DM_SDATA -DM_STEXT -DM_I386 -DM_XENIX -DM_BITFIELDS \
- X+ -Di386 -DM_XOUT -DM_SYS5 -DM_SYSV -DM_SYS3 -DM_SYSIII \
- X+ -DM_WORDSWAP"
- X+
- X+ /* no #sccs in preprocessor. */
- X+
- X+ #undef SCCS_DIRECTIVE
- X+
- X+ /* no #ident */
- X+
- X+ /* #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME); */
- X+
- X+ /* We dont want to output SDB debugging information. */
- X+
- X+ #undef SDB_DEBUGGING_INFO
- X+
- X+ /* We want to output DBX debugging information, for use with GDB only */
- X+
- X+ #define DBX_DEBUGGING_INFO
- X+
- X+ /* Implicit library calls should use memcpy, not bcopy, etc. */
- X+
- X+ #define TARGET_MEM_FUNCTIONS
- X+
- X+ /* Writing `int' for a bitfield forces int alignment for the structure. */
- X+
- X+ #undef PCC_BITFIELD_TYPE_MATTERS
- X+
- X+ /* Generate an external symbol request for __fltused if 80387 selected */
- X+
- X+ #undef ASM_FILE_START
- X+ #define ASM_FILE_START(FILE) \
- X+ { fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name); \
- X+ if (TARGET_80387) \
- X+ fprintf (FILE, "\t.stabs\t\"__fltused\",0,0,0,0\n"); }
- X+
- X+
- X+ /* Machines that use the AT&T assembler syntax
- X+ also return floating point values in an FP register. */
- X+ /* Define how to find the value returned by a function.
- X+ VALTYPE is the data type of the value (as a tree).
- X+ If the precise function being called is known, FUNC is its FUNCTION_DECL;
- X+ otherwise, FUNC is 0. */
- X+
- X+ #define VALUE_REGNO(MODE) \
- X+ (((MODE)==SFmode || (MODE)==DFmode) ? FIRST_FLOAT_REG : 0)
- X+
- X+ /* 1 if N is a possible register number for a function value. */
- X+
- X+ #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N)== FIRST_FLOAT_REG)
- X+
- X+ /* Put address tables in data segment */
- X+
- X+ #undef ASM_OUTPUT_CASE_LABEL
- X+ #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,JUMPTABLE) \
- X+ { data_section(); \
- X+ ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM); }
- X+
- X+ #undef ASM_OUTPUT_CASE_END
- X+ #define ASM_OUTPUT_CASE_END(FILE,NUM,INSN) text_section()
- X+
- X+ #undef FUNCTION_PROFILER
- X+ #define FUNCTION_PROFILER(FILE, LABELNO) \
- X+ fprintf (FILE, "\tmovl $%sP%d,%%edx\n\tcall __mcount\n", LPREFIX, (LABELNO));
- X*** gcc-1.40/config/tm-xgas386.h
- X--- config/tm-xgas386.h Wed Jul 10 15:56:17 1991
- X***************
- X*** 0 ****
- X--- 1,253 ----
- X+ /* Definitions for AT&T assembler syntax for the Intel 80386.
- X+ Copyright (C) 1988 Free Software Foundation, Inc.
- X+
- X+ This file is part of GNU CC.
- X+
- X+ GNU CC is free software; you can redistribute it and/or modify
- X+ it under the terms of the GNU General Public License as published by
- X+ the Free Software Foundation; either version 1, or (at your option)
- X+ any later version.
- X+
- X+ GNU CC is distributed in the hope that it will be useful,
- X+ but WITHOUT ANY WARRANTY; without even the implied warranty of
- X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X+ GNU General Public License for more details.
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with GNU CC; see the file COPYING. If not, write to
- X+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+
- X+ #ifdef PRAGMA_PACK
- X+ #define TARGET_VERSION fprintf (stderr, " (80386, Xenix GAS syntax, #pragma pack() support included)");
- X+ #else
- X+ #define TARGET_VERSION fprintf (stderr, " (80386, Xenix GAS syntax)");
- X+ #endif
- X+
- X+ /* Define the syntax of instructions and addresses. */
- X+
- X+ /* Define some concatenation macros to concatenate an opcode
- X+ and one, two or three operands. In other assembler syntaxes
- X+ they may alter the order of ther operands. */
- X+
- X+ #ifdef __STDC__
- X+ #define AS2(a,b,c) #a " " #b "," #c
- X+ #define AS3(a,b,c,d) #a " " #b "," #c "," #d
- X+ #define AS1(a,b) #a " " #b
- X+ #else
- X+ #define AS1(a,b) "a b"
- X+ #define AS2(a,b,c) "a b,c"
- X+ #define AS3(a,b,c,d) "a b,c,d"
- X+ #endif
- X+
- X+ /* Output the size-letter for an opcode.
- X+ CODE is the letter used in an operand spec (L, B, W, S or Q).
- X+ CH is the corresponding lower case letter
- X+ (except if CODE is L then CH is `l'). */
- X+ #define PUT_OP_SIZE(CODE,CH,FILE) putc (CH,(FILE))
- X+
- X+ /* Opcode suffix for fullword insn. */
- X+ #define L_SIZE "l"
- X+
- X+ /* Prefix for register names in this syntax. */
- X+ #define RP "%"
- X+
- X+ /* Prefix for immediate operands in this syntax. */
- X+ #define IP "$"
- X+
- X+ /* Prefix for internally generated assembler labels. */
- X+ #define LPREFIX ".L"
- X+
- X+ /* Output the prefix for an immediate operand, or for an offset operand. */
- X+ #define PRINT_IMMED_PREFIX(FILE) fputs ("$", (FILE))
- X+ #define PRINT_OFFSET_PREFIX(FILE) fputs ("$", (FILE))
- X+
- X+ /* Indirect call instructions should use `*'. */
- X+ #define USE_STAR 1
- X+
- X+ /* Prefix for a memory-operand X. */
- X+ #define PRINT_PTR(X, FILE)
- X+
- X+ /* Delimiters that surround base reg and index reg. */
- X+ #define ADDR_BEG(FILE) putc('(', (FILE))
- X+ #define ADDR_END(FILE) putc(')', (FILE))
- X+
- X+ /* Print an index register (whose rtx is IREG). */
- X+ #define PRINT_IREG(FILE,IREG) \
- X+ do \
- X+ { fputs (",", (FILE)); PRINT_REG ((IREG), 0, (FILE)); } \
- X+ while (0)
- X+
- X+ /* Print an index scale factor SCALE. */
- X+ #define PRINT_SCALE(FILE,SCALE) \
- X+ if ((SCALE) != 1) fprintf ((FILE), ",%d", (SCALE))
- X+
- X+ /* Print a base/index combination.
- X+ BREG is the base reg rtx, IREG is the index reg rtx,
- X+ and SCALE is the index scale factor (an integer). */
- X+
- X+ #define PRINT_B_I_S(BREG,IREG,SCALE,FILE) \
- X+ { ADDR_BEG (FILE); \
- X+ if (BREG) PRINT_REG ((BREG), 0, (FILE)); \
- X+ if ((IREG) != 0) \
- X+ { PRINT_IREG ((FILE), (IREG)); \
- X+ PRINT_SCALE ((FILE), (SCALE)); } \
- X+ ADDR_END (FILE); }
- X+
- X+ /* Define the syntax of pseudo-ops, labels and comments. */
- X+
- X+ /* Assembler pseudos to introduce constants of various size. */
- X+
- X+ #define ASM_BYTE "\t.byte "
- X+ #define ASM_SHORT "\t.value "
- X+ #define ASM_LONG "\t.long "
- X+ #define ASM_DOUBLE "\t.double "
- X+
- X+ /* String containing the assembler's comment-starter. */
- X+
- X+ #define COMMENT_BEGIN "/"
- X+
- X+ /* Output at beginning of assembler file. */
- X+ /* The .file command should always begin the output. */
- X+
- X+ #undef ASM_FILE_START
- X+ #define ASM_FILE_START(FILE) \
- X+ fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);
- X+
- X+ /* Don't write a `.optim' pseudo; this assembler doesn't handle them. */
- X+
- X+ #undef ASM_FILE_START_1
- X+ #define ASM_FILE_START_1(FILE)
- X+
- X+ /* Output to assembler file text saying following lines
- X+ may contain character constants, extra white space, comments, etc. */
- X+
- X+ #define ASM_APP_ON "/APP\n"
- X+
- X+ /* Output to assembler file text saying following lines
- X+ no longer contain unusual constructs. */
- X+
- X+ #define ASM_APP_OFF "/NO_APP\n"
- X+
- X+ /* This is how to output an assembler line
- X+ that says to advance the location counter by SIZE bytes. */
- X+
- X+ #define ASM_OUTPUT_SKIP(FILE,SIZE) \
- X+ fprintf ((FILE), "\t.set .,.+%d\n", (SIZE))
- X+
- X+ /* Output before read-only data. */
- X+
- X+ #define TEXT_SECTION_ASM_OP ".text"
- X+
- X+ /* Output before writable data. */
- X+
- X+ #define DATA_SECTION_ASM_OP ".data"
- X+
- X+ /* Define the syntax of labels and symbol definitions/declarations. */
- X+
- X+ /* This says how to output an assembler line
- X+ to define a global common symbol. */
- X+ /* We don't use ROUNDED because the standard compiler doesn't,
- X+ and the linker gives error messages if a common symbol
- X+ has more than one length value. */
- X+
- X+ #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
- X+ ( fputs (".comm ", (FILE)), \
- X+ assemble_name ((FILE), (NAME)), \
- X+ fprintf ((FILE), ",%d\n", (SIZE)))
- X+
- X+ /* This says how to output an assembler line
- X+ to define a local common symbol. */
- X+
- X+ /* Try lcomm to generate local bss
- X+ *
- X+ * #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
- X+ * (data_section (), \
- X+ * ASM_OUTPUT_LABEL ((FILE), (NAME)), \
- X+ * fprintf ((FILE), "\t.set .,.+%d\n", (ROUNDED)))
- X+ */
- X+ #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
- X+ ( fputs (".lcomm ", (FILE)), \
- X+ assemble_name ((FILE), (NAME)), \
- X+ fprintf ((FILE), ",%d\n", (SIZE)))
- X+
- X+
- X+ /* This is how to output an assembler line
- X+ that says to advance the location counter
- X+ by a multiple of 2**LOG bytes. */
- X+
- X+ #define ASM_OUTPUT_ALIGN(FILE,LOG) \
- X+ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", (LOG))
- X+
- X+ /* This is how to store into the string BUF
- X+ the symbol_ref name of an internal numbered label where
- X+ PREFIX is the class of label and NUM is the number within the class.
- X+ This is suitable for output with `assemble_name'. */
- X+
- X+ #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
- X+ sprintf ((BUF), "*.%s%d", (PREFIX), (NUMBER))
- X+
- X+ /* This is how to output an internal numbered label where
- X+ PREFIX is the class of label and NUM is the number within the class. */
- X+
- X+ #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
- X+ fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
- X+
- X+ /* This is how to output a reference to a user-level label named NAME. */
- X+
- X+ #define ASM_OUTPUT_LABELREF(FILE,NAME) \
- X+ fprintf (FILE, "_%s", NAME)
- X+
- X+ /* This is how to output a command to make the user-level label named NAME
- X+ defined for reference from other files. */
- X+
- X+ #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
- X+ (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
- X+
- X+ /* How to output an ASCII string constant. */
- X+
- X+ #define ASM_OUTPUT_ASCII(FILE, p, size) \
- X+ { int i=0; \
- X+ while (i < size) \
- X+ { if (i%10 == 0) { if (i!=0) fprintf (FILE, "\n"); \
- X+ fprintf (FILE, ASM_BYTE); } \
- X+ else fprintf (FILE, ","); \
- X+ fprintf (FILE, "0x%x",(p[i++] & 0377)) ;} \
- X+ fprintf (FILE, "\n"); }
- X+
- X+ #define EXTRA_SECTIONS in_cdata
- X+
- X+ /* Define the additional functions to select our additional sections. */
- X+
- X+ #define CDATA_SECTION_ASM_OP ".data 1"
- X+
- X+ #define EXTRA_SECTION_FUNCTIONS \
- X+ void \
- X+ cdata_section () \
- X+ { \
- X+ if (in_section != in_cdata) \
- X+ { \
- X+ fprintf (asm_out_file, "%s\n", CDATA_SECTION_ASM_OP); \
- X+ in_section = in_cdata; \
- X+ } \
- X+ }
- X+
- X+ /* Given a decl node or constant node, choose the section to output it in
- X+ and select that section. */
- X+
- X+ /* following takes care of constants emitted from
- X+ the hash table entries (see above comment)
- X+ */
- X+ #define SELECT_SECTION_MODE(MODE,RTX) cdata_section();
- X+ #define SELECT_RTX_SECTION(MODE, RTX) cdata_section();
- X+ #define SELECT_SECTION(DECL) \
- X+ { if (TREE_CODE (DECL) == STRING_CST) { \
- X+ if (flag_writable_strings) \
- X+ data_section (); \
- X+ else \
- X+ cdata_section (); \
- X+ } \
- X+ else if (TREE_READONLY (DECL) && ! TREE_VOLATILE (DECL)) \
- X+ cdata_section (); \
- X+ else \
- X+ data_section (); }
- X*** gcc-1.40/config/xm-xenix386.h
- X--- config/xm-xenix386.h Fri Jul 12 07:43:58 1991
- X***************
- X*** 0 ****
- X--- 1,55 ----
- X+ /* Configuration for GNU C-compiler for Intel 80386 running SCO Xenix 386
- X+ Copyright (C) 1988 Free Software Foundation, Inc.
- X+
- X+ This file is part of GNU CC.
- X+
- X+ GNU CC is free software; you can redistribute it and/or modify
- X+ it under the terms of the GNU General Public License as published by
- X+ the Free Software Foundation; either version 1, or (at your option)
- X+ any later version.
- X+
- X+ GNU CC is distributed in the hope that it will be useful,
- X+ but WITHOUT ANY WARRANTY; without even the implied warranty of
- X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X+ GNU General Public License for more details.
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with GNU CC; see the file COPYING. If not, write to
- X+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
- X+
- X+
- X+ /* #defines that need visibility everywhere. */
- X+ #define FALSE 0
- X+ #define TRUE 1
- X+
- X+ /* This describes the machine the compiler is hosted on. */
- X+ #define HOST_BITS_PER_CHAR 8
- X+ #define HOST_BITS_PER_SHORT 16
- X+ #define HOST_BITS_PER_INT 32
- X+ #define HOST_BITS_PER_LONG 32
- X+
- X+ /* Arguments to use with `exit'. */
- X+ #define SUCCESS_EXIT_CODE 0
- X+ #define FATAL_EXIT_CODE 33
- X+
- X+ #define USG
- X+
- X+ #ifndef __GNUC__
- X+ #define register auto /* Register variables are broken */
- X+ #endif
- X+
- X+ /* target machine dependencies.
- X+ tm.h is a symbolic link to the actual target specific file. */
- X+ #include "tm.h"
- X+
- X+ #define bcopy(a,b,c) memcpy (b,a,c)
- X+ #define bzero(a,b) memset (a,0,b)
- X+ #define bcmp(a,b,c) memcmp (a,b,c)
- X+
- X+ #ifdef __GNUC__
- X+ #define alloca(n) __builtin_alloca(n)
- X+ #endif
- X+
- X+ /* Implement Microsoft C compatible #pragma pack() */
- X+
- X+ #define PRAGMA_PACK
- X*** gcc-1.40/config.gcc Mon Jul 29 13:16:42 1991
- X--- config.gcc Wed Jul 10 15:56:16 1991
- X***************
- X*** 331,336 ****
- X--- 331,340 ----
- X # 370)
- X # machine=370
- X # ;;
- X+ xenix386) # for SCO Xenix/386
- X+ cpu_type=i386
- X+ configuration_file=xm-${machine}.h
- X+ ;;
- X esac
- X
- X # if cpu_type is not set, define cpu_type to machine.
- X*** gcc-1.40/gcc.c Mon Jul 29 13:16:57 1991
- X--- gcc.c Fri Jul 12 08:15:31 1991
- X***************
- X*** 303,312 ****
- X--- 303,316 ----
- X };
- X
- X /* Here is the spec for running the linker, after compiling all files. */
- X+ #ifdef FULL_LINK_SPEC
- X+ char *link_spec = FULL_LINK_SPEC
- X+ #else
- X char *link_spec = "%{!c:%{!M*:%{!E:%{!S:ld %{o*} %l\
- X %{A} %{d} %{e*} %{N} %{n} %{r} %{s} %{S} %{T*} %{t} %{u*} %{X} %{x} %{z}\
- X %{y*} %{!A:%{!nostdlib:%S}} \
- X %{L*} %o %{!nostdlib:%G gnulib%s %L gnulib%s %{!A:%E}}\n }}}}";
- X+ #endif
- X
- X /* Accumulate a command (program name and args), and run it. */
- X
- X***************
- X*** 361,368 ****
- X #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
- X #endif /* !defined STANDARD_STARTFILE_PREFIX */
- X
- X char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
- X! char *standard_startfile_prefix_1 = "/lib/";
- X char *standard_startfile_prefix_2 = "/usr/lib/";
- X
- X /* Clear out the vector of arguments (after a command is executed). */
- X--- 365,376 ----
- X #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
- X #endif /* !defined STANDARD_STARTFILE_PREFIX */
- X
- X+ #ifndef STANDARD_STARTFILE_PREFIX_1
- X+ #define STANDARD_STARTFILE_PREFIX_1 "/lib/"
- X+ #endif /* !defined STANDARD_STARTFILE_PREFIX_1 */
- X+
- X char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
- X! char *standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1;
- X char *standard_startfile_prefix_2 = "/usr/lib/";
- X
- X /* Clear out the vector of arguments (after a command is executed). */
- X***************
- X*** 1383,1389 ****
- X
- X char *
- X handle_braces (p)
- X! register char *p;
- X {
- X register char *q;
- X char *filter;
- X--- 1391,1397 ----
- X
- X char *
- X handle_braces (p)
- X! char *p;
- X {
- X register char *q;
- X char *filter;
- X*** gcc-1.40/pragmapack.c
- X--- pragmapack.c Wed Jul 10 16:57:32 1991
- X***************
- X*** 0 ****
- X--- 1,26 ----
- X+ #define DEFAULT_ALIGN 32
- X+
- X+ static int pack_align = DEFAULT_ALIGN;
- X+ static int was_pragma = 0;
- X+
- X+ pragma_pack(val)
- X+ int val;
- X+ {
- X+ pack_align = 8 * val;
- X+ was_pragma = 1;
- X+ }
- X+
- X+ pragma_align_val()
- X+ {
- X+ return pack_align;
- X+ }
- X+
- X+ pragma_pack_default()
- X+ {
- X+ pack_align = DEFAULT_ALIGN;
- X+ }
- X+
- X+ int pragma_pack_seen()
- X+ {
- X+ return was_pragma;
- X+ }
- X*** gcc-1.40/stor-layout.c Mon Jul 29 13:17:35 1991
- X--- stor-layout.c Wed Jul 10 15:56:23 1991
- X***************
- X*** 514,519 ****
- X--- 514,523 ----
- X or some divisor of it. */
- X
- X layout_decl (field, var_size ? size_unit : const_size);
- X+ #ifdef PRAGMA_PACK
- X+ if (pragma_pack_seen())
- X+ DECL_ALIGN(field) = MIN(pragma_align_val(), DECL_ALIGN(field));
- X+ #endif
- X desired_align = DECL_ALIGN (field);
- X
- X /* Record must have at least as much alignment as any field.
- X*** gcc-1.40/c-parse.tab.c Mon Jul 29 13:21:25 1991
- X--- c-parse.tab.c Mon Jul 29 13:53:35 1991
- X***************
- X*** 3201,3206 ****
- X--- 3205,3251 ----
- X && getc (finput) == 'm'
- X && getc (finput) == 'a'
- X && ((c = getc (finput)) == ' ' || c == '\t' || c == '\n'))
- X+ #ifdef PRAGMA_PACK
- X+ {
- X+ token = yylex();
- X+ if (token != IDENTIFIER)
- X+ goto skipline;
- X+
- X+ if (strcmp(token_buffer, "pack") != 0)
- X+ goto skipline;
- X+
- X+ token = yylex();
- X+ if (token != '(') {
- X+ error ("invalid #pragma pack expecting '('");
- X+ goto skipline;
- X+ }
- X+
- X+ /* setup default alignment first */
- X+
- X+ pragma_pack_default();
- X+
- X+ token = yylex();
- X+ if (token != ')')
- X+ {
- X+ if (token == CONSTANT
- X+ && TREE_CODE (yylval.ttype) == INTEGER_CST) {
- X+ int l = TREE_INT_CST_LOW (yylval.ttype);
- X+ pragma_pack(l);
- X+ }
- X+ else {
- X+ error ("invalid #pragma pack expecting 1, 2 or 4");
- X+ goto skipline;
- X+ }
- X+
- X+ token = yylex();
- X+ }
- X+
- X+ if (token != ')') {
- X+ error ("invalid #pragma pack expecting ')'");
- X+ goto skipline;
- X+ }
- X+ }
- X+ #endif
- X goto skipline;
- X }
- X
- X*** fix.h.xenix
- X--- fix.h.xenix Thu Aug 22 21:18:21 1991
- X***************
- X*** 0 ****
- X--- 1,198 ----
- X+ # @(#) $Id: fix.h.xenix,v 1.3 1991/08/22 05:39:05 ronald Exp $
- X+ #
- X+ # (C) Copyright 1990, 1991 Ronald Khoo <ronald@ibmpcug.co.uk>
- X+ # Permission granted to use or abuse this program for any purpose,
- X+ # provided that all modified copies are clearly marked as such.
- X+ # No warranty is given for the fitness of this program for any purpose.
- X+ #
- X+ # Please treat this file as a document saying what I did and not really
- X+ # a program. i.e. Please read it through before considering running it.
- X+ #
- X+ # This is a quick hack to fix the SCO Xenix 386 include files so that
- X+ # they work with gcc at all. No attempt has been made to do this
- X+ # in a general way whatsoever, and this script was not made with any
- X+ # reference to the GCC fixincludes script: I still have no idea what
- X+ # that does. This works (ish) for me. Your mileage may vary.
- X+ # My include files were from the 2.3.4 operating system and the 2.3.1b
- X+ # development system.
- X+ #
- X+ # What the script does do:
- X+ #
- X+ # * stream edit files from /usr/include and /usr/include/sys
- X+ # into /usr/local/lib/gcc-include, skipping those which are
- X+ # provided by GCC.
- X+ # * make all references to M_I386 refer to __M_I386__ instead.
- X+ # This enables programs compiled with gcc -ansi not to coredump.
- X+ # This only works with gcc so don't give these hacked .h files to cc !!
- X+ # * put protection #ifdef tests to all files to allow them to be safely
- X+ # multiply included.
- X+ # * time_t and size_t seem to be typedefed all over the place. Protect them.
- X+ # * remove definition and use of va_list in stdio.h -- that's bogus.
- X+ # (SCO has already fixed this one in 2.3.1)
- X+ # * make types of SIG_IGN, etc consistently void * in sys/signal.h
- X+ # (to be consistent with <signal.h>)
- X+ # * various other individual hacks I've come across. Note that these
- X+ # are entirely ad-hoc. You can find them in the lines starting with
- X+ # sed_<name>="
- X+ #
- X+ # In particular, the ad-hocery was intended to make rcs 5.5 compile without
- X+ # hacking, even with all the recommended warning options set.
- X+ # It doesn't quite work -- rcs 5.5's configuration script is slightly broken.
- X+ # I hate gratuitous declarations.
- X+ #
- X+ # Note that this is only a beginning. I keep finding annoyances which
- X+ # have to be fixed by hand. Many prototypes are wrong in places like
- X+ # <stdio.h>, <stdlib.h> etc. An afternoon spent with an editor in one
- X+ # hand and the ANSI standard in the other would probably not go amiss.
- X+ #
- X+ # This script will probably fall flat on its face if you've already
- X+ # modified the system include files to do what it wants to do.
- X+ # Starting from a fresh set may be a reasonable approach.
- X+ #
- X+ # $Log: fix.h.xenix,v $
- X+ # Revision 1.3 1991/08/22 05:39:05 ronald
- X+ # pre-release version for gfm@mencon.oz to try out.
- X+ #
- X+ # Revision 1.2 1991/08/19 10:55:30 ronald
- X+ # Interim release for gcc 1.40, beta testers.
- X+ #
- X+ # Revision 1.1 90/04/25 18:51:21 ronald
- X+ # Initial revision
- X+ #
- X+
- X+ PATH=/etc:/bin:/usr/bin export PATH
- X+
- X+ # usage: /usr/local/lib/fix.h.xenix
- X+
- X+ lib=${lib-/usr/local/lib}
- X+ include=$lib/gcc-include
- X+ stdinc=${stdinc-/usr/include}
- X+
- X+ sed_mi386=" -e '/\\([^_]\\)M_I386/s//\\1__M_I386__/g'"
- X+ sed_timet=" -e '/typedef.*[ ]time_t/ {
- X+ i\\
- X+ #ifndef _TIME_T
- X+ i\\
- X+ #define _TIME_T
- X+ a\\
- X+ #endif /* _TIME_T */
- X+ }'"
- X+ sed_sizet=" -e '/typedef.*[ ]size_t/ {
- X+ i\\
- X+ #ifndef _SIZE_T
- X+ i\\
- X+ #define _SIZE_T
- X+ a\\
- X+ #endif /* _SIZE_T */
- X+ }'"
- X+ # No prizes for guessing what this macro is used for.
- X+ # Also, no prizes for guessing which editor I use.
- X+ # :s/^[ ]*\([^( ]*\)[ ]*\((.*\);[ ]*$/ \/\\\\(\1[ ]*\\\\)([^)][^)]*)\/s\/\/\\\\1 \2\//
- X+ #
- X+ sed_param=" -e '
- X+ /\(\/\*[^/]*\)\/\*/s//\1 *\/ \/*/
- X+ /^\/\*.*\/\*.*pdp11[ ]*\$/s/\$/*\//
- X+ '"
- X+ sed_errno=" -e '
- X+ /\\(perror[ ]*\\)([^)][^)]*)/s//\\1 ( const char * )/
- X+ '"
- X+ sed_stdlib=" -e '
- X+ /\\(getenv[ ]*\\)([^)][^)]*)/s//\\1 (const char *)/
- X+ /\\(atoi[ ]*\\)([^)][^)]*)/s//\\1 (const char *)/
- X+ /.*\\(free[ ]*\\)([^)][^)]*)/s//extern void \\1 ( void * )/
- X+ /.*\\(malloc[ ]*\\)([^)][^)]*)/s//extern void *\\1 (unsigned)/
- X+ /.*\\(realloc[ ]*\\)([^)][^)]*)/s//extern void *\\1 (void *, unsigned)/
- X+ /.*\\(calloc[ ]*\\)([^)][^)]*)/s//extern void *\\1 (unsigned, unsigned)/
- X+ '"
- X+ sed_stdio=" -e '
- X+ /\\(printf[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, ...)/
- X+ /\\(fprintf[ ]*\\)([^)][^)]*)/s//\\1 ( FILE *, const char *, ... )/
- X+ /\\(vfprintf[ ]*\\)([^)][^)]*)/s//\\1 ( FILE *, const char *, char * )/
- X+ /\\(vprintf[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, char * )/
- X+ /\\(sprintf[ ]*\\)([^)][^)]*)/s//\\1 ( char *, const char *, ... )/
- X+ /\\(vsprintf[ ]*\\)([^)][^)]*)/s//\\1 ( char *, const char *, char * )/
- X+ /\\(fopen[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, const char * )/
- X+ /\\(fdopen[ ]*\\)([^)][^)]*)/s//\\1 ( int, const char * )/
- X+ /\\(fputs[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, FILE * )/
- X+ /\\(fread[ ]*\\)([^)][^)]*)/s//\\1 ( void *, size_t, size_t, FILE * )/
- X+ /\\(fwrite[ ]*\\)([^)][^)]*)/s//\\1 ( const void *, size_t, size_t, FILE * )/
- X+ /typedef.*va_list/d
- X+ /va_list/s//char */
- X+ '"
- X+ sed_string=" -e '
- X+ /\\(strlen[ ]*\\)([^)][^)]*)/s//\\1 ( const char * )/
- X+ /\\(strcat[ ]*\\)([^)][^)]*)/s//\\1 ( char *, const char * )/
- X+ /\\(strncat[ ]*\\)([^)][^)]*)/s//\\1 ( char *, const char *, int )/
- X+ /\\(strcpy[ ]*\\)([^)][^)]*)/s//\\1 ( char *, const char * )/
- X+ /\\(strncpy[ ]*\\)([^)][^)]*)/s//\\1 ( char *, const char *, int )/
- X+ /\\(strchr[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, int )/
- X+ /\\(strrchr[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, int )/
- X+ /\\(strcmp[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, const char * )/
- X+ /\\(strncmp[ ]*\\)([^)][^)]*)/s//\\1 ( const char *, const char *, int )/
- X+ /define.*strerror.*;[ ]*\$/s/;[ ]*\$//
- X+ '"
- X+ sed_signal=" -e '/int.*(\\*)/s/int/void/g'"
- X+ sed_error=" -e '/^[ ]*ERROR[ ]\\(.*\\)\$/ {
- X+ s//\\1/
- X+ s/\"//g
- X+ s/[ ][ ]*/ /g
- X+ s/.*/ #error \"&\"/
- X+ }'"
- X+
- X+ hackit()
- X+ {
- X+ echo "\r \rHacking $1\c" >&2
- X+ idemp=
- X+ expr "`sed 1q $1`" : '.*ifn.*_H.*' > /dev/null && idemp=yes
- X+ test "$idemp" || {
- X+ name=_INCLUDED_`echo $1 | tr './[a-z]' '__[A-Z]'`_AUTOFIX
- X+ echo "#ifndef $name" > $include/$1
- X+ echo "#define $name" >> $include/$1
- X+ }
- X+ script="$sed_mi386"
- X+ grep -s size_t $1 > /dev/null &&
- X+ grep -s _SIZE_T $1 > /dev/null || script="$script $sed_sizet"
- X+ grep -s time_t $1 > /dev/null &&
- X+ grep -s _TIME_T $1 > /dev/null || script="$script $sed_timet"
- X+ case $1 in
- X+ errno.h) script="$script $sed_errno" ;;
- X+ stdlib.h) script="$script $sed_stdlib" ;;
- X+ string.h) script="$script $sed_string" ;;
- X+ stdio.h) script="$script $sed_errno $sed_stdio" ;;
- X+ sys/param.h) script="$script $sed_param" ;;
- X+ sys/signal.h) script="$script $sed_signal" ;;
- X+ curses.h|sys/emap.h|sys/param.h|sys/sxt.h)
- X+ script="$script $sed_error" ;;
- X+ esac
- X+ eval sed "$script" $1 >> $include/$1
- X+ test "$idemp" || echo "#endif /* $name */" >> $include/$1
- X+ }
- X+
- X+ [ -d $include ] || mkdir $include
- X+ [ -d $include/sys ] || mkdir $include/sys
- X+
- X+ cd $stdinc || exit 1
- X+ echo "\rHacking files from $stdinc into $include" >&2
- X+
- X+ # This bit is useful for hacking the sed scripts above.
- X+ # for i in sys/param.h # stdio.h stdlib.h errno.h curses.h string.h
- X+ # do hackit $i ; done
- X+ # exit 1
- X+
- X+ for i in *.h
- X+ do
- X+ case $i in
- X+ # Use the GCC supplied versions of these files:
- X+ assert.h|float.h|limits.h|stdarg.h|stddef.h|varargs.h) ;;
- X+ *) hackit $i ;;
- X+ esac
- X+ done
- X+
- X+ echo "\rHacking files from $stdinc/sys into $include/sys" >&2
- X+ for i in sys/*.h ; do hackit $i ; done
- X+
- X+ cd $include
- X+ cd sys ; chgrp bin . *.h ; chmod 664 *.h ; chmod 775 . ; chown bin . *.h
- X+ cd .. ; chgrp bin . *.h ; chmod 664 *.h ; chmod 775 . ; chown bin . *.h
- X+
- X+ echo '\r..... done. Have a nice day. --Ronald' >&2
- X*** fixmin.xenix
- X--- fixmin.xenix Thu Aug 22 21:09:28 1991
- X***************
- X*** 0 ****
- X--- 1,76 ----
- X+ # $Id: fixmin.xenix,v 1.1 1991/08/22 20:06:32 ronald Exp $
- X+ # Change Log is at the end of the file.
- X+ #
- X+ # This is the bare minimum of header fixing that I could get away with
- X+ # in order to compile GCC. This applies to Xenix 2.3.3 with 2.3.1
- X+ # Development System. You're on your own with other versions.
- X+ # These changes should only be in effect while building gcc.
- X+ # You should undo them, and replace the fixes with something better
- X+ # in /usr/local/lib/gcc-include once you've installed gcc.
- X+
- X+ # usage: fixmin.xenix [ undo ]
- X+ # If the "undo" parameter is specified, reverses the actions of a
- X+ # previous run of fixmin.
- X+
- X+ cd /usr/include
- X+
- X+ if test "$1" = undo ; then
- X+ for i in *.bfm ; do
- X+ j=`basename $i .bfm`
- X+ mv $i $j
- X+ echo restored $j >&2
- X+ done
- X+ cd sys
- X+ for i in *.bfm ; do
- X+ j=`basename $i .bfm`
- X+ mv $i $j
- X+ echo restored sys/$j >&2
- X+ done
- X+ exit 0
- X+ fi
- X+
- X+ for i in stdio.h time.h string.h sys/types.h ; do
- X+ if egrep '(_SIZE_T|_TIME_T)' $i > /dev/null || test -r $i.bfm; then
- X+ : do nothing, already there
- X+ else
- X+ echo fixing $i
- X+ sed '/typedef.*[ ]size_t/ {
- X+ i\
- X+ #ifndef _SIZE_T
- X+ i\
- X+ #define _SIZE_T
- X+ a\
- X+ #endif
- X+ }
- X+ /typedef.*[ ]time_t/ {
- X+ i\
- X+ #ifndef _TIME_T
- X+ i\
- X+ #define _TIME_T
- X+ a\
- X+ #endif
- X+ }' $i > $i.new
- X+ mv $i $i.bfm
- X+ mv $i.new $i
- X+ fi
- X+ done
- X+
- X+ if sed 1q stdio.h | grep -s 'ifndef[ ][ ]*FILE' > /dev/null ; then
- X+ : do nothing -- already there.
- X+ else
- X+ echo stdio.h once more ...
- X+ ed stdio.h <<-\EOF
- X+ 0a
- X+ #ifndef FILE
- X+ .
- X+ $a
- X+ #endif
- X+ .
- X+ w
- X+ EOF
- X+ fi
- X+ #
- X+ # $Log: fixmin.xenix,v $
- X+ # Revision 1.1 1991/08/22 20:06:32 ronald
- X+ # Initial revision
- X+ #
- X*** xenixld.c
- X--- xenixld.c Thu Aug 22 21:17:40 1991
- X***************
- X*** 0 ****
- X--- 1,264 ----
- X+ static char rcsid[] = "@(#) $Id: xenixld.c,v 1.2 1991/08/22 20:17:03 ronald Exp $\n";
- X+ /*
- X+ * This is the version distributed by RoboBar limited, currently maintained
- X+ * by Ronald Khoo <ronald@ibmpcug.co.uk>
- X+ *
- X+ * $Log: xenixld.c,v $
- X+ * Revision 1.2 1991/08/22 20:17:03 ronald
- X+ * Baseline for release with GCC 1.40
- X+ * Various mods by Steve, and a hack to prevent loading of COFF files.
- X+ *
- X+ */
- X+ /* Linker driver program for Xenix that can handle gcc command lines
- X+ Copyright (C) 1990 Christoph Badura
- X+
- X+ Comments and buggestions are welcome. Write to bad@flatlin.sub.org.
- X+
- X+ This file is not part of GNU CC.
- X+
- X+ This program is free software; you can redistribute it and/or modify
- X+ it under the terms of the GNU General Public License as published by
- X+ the Free Software Foundation; either version 1, or (at your option)
- X+ any later version.
- X+
- X+ This program is distributed in the hope that it will be useful,
- X+ but WITHOUT ANY WARRANTY; without even the implied warranty of
- X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X+ GNU General Public License for more details.
- X+
- X+ You should have received a copy of the GNU General Public License
- X+ along with GNU CC; see the file COPYING. If not, write to
- X+ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- X+
- X+ */
- X+
- X+ #include <stdio.h>
- X+
- X+ #include "config.h"
- X+
- X+ #ifdef USG
- X+ #define R_OK 4
- X+ #define W_OK 2
- X+ #define X_OK 1
- X+ #define vfork fork
- X+ #endif /* USG */
- X+
- X+ extern void free ();
- X+
- X+ /* Default prefixes to attach to command names. */
- X+
- X+ #ifndef STANDARD_STARTFILE_PREFIX
- X+ #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
- X+ #endif /* !defined STANDARD_STARTFILE_PREFIX */
- X+
- X+ char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
- X+ char *standard_startfile_prefix_1 = "/lib/386/";
- X+ char *standard_startfile_prefix_2 = "/usr/lib/";
- X+
- X+ char * progname; /* who am i */
- X+
- X+ fatal (char *msg)
- X+ {
- X+ fprintf (stderr, "%s:%s\n", progname, msg);
- X+ exit (1);
- X+ }
- X+
- X+ xmalloc (size)
- X+ int size;
- X+ {
- X+ register int value = malloc (size);
- X+ if (!value)
- X+ fatal ("Virtual memory full.");
- X+ return value;
- X+ }
- X+
- X+ xrealloc (void *ptr, int size)
- X+ {
- X+ register int value = realloc (ptr, size);
- X+ if (!value)
- X+ fatal ("Virtual memory full.");
- X+ return value;
- X+ }
- X+
- X+ struct lib_path {
- X+ struct lib_path *next;
- X+ int length; /* length of following string */
- X+ char *path;
- X+ };
- X+
- X+ struct lib_path *lib_path; /* the library search path */
- X+
- X+ struct lib_path *
- X+ add_path (char *name, struct lib_path *prev)
- X+ {
- X+ int size;
- X+ struct lib_path *lp;
- X+
- X+ #ifdef DEBUG
- X+ fprintf (stderr, "%s: adding %s to library path\n", progname, name);
- X+ #endif
- X+ lp = (struct lib_path *) xmalloc (sizeof (struct lib_path));
- X+ lp->next = prev;
- X+ lp->length = strlen (name);
- X+ lp->path = name;
- X+ return lp;
- X+ }
- X+
- X+ /*
- X+ * Added by Ronald.Khoo@ibmpcug.co.uk:
- X+ * SCO systems have two kinds of libraries, OMF and COFF. XENIX GCC/G++
- X+ * only works with OMF, this hack prevents the program accidentally finding
- X+ * COFF libraries earlier in the search path from the corresponding OMF one.
- X+ */
- X+ int
- X+ islib(char *name)
- X+ {
- X+ int i;
- X+ FILE *fp = fopen(name, "r");
- X+ if (fp == 0)
- X+ return 0;
- X+ i = getw(fp);
- X+ fclose(fp);
- X+ return (i & 0xff) == 0x80 /* OMF */ || (i & 0xffff) == 0xff65 /* ar */;
- X+ }
- X+
- X+ char *
- X+ find_library_1 (char *name)
- X+ {
- X+ struct lib_path *lp;
- X+ int name_size, size = 0;
- X+ char *temp_name = 0;
- X+ int win = 0;
- X+
- X+ name_size = strlen (name) + 1;
- X+ for (lp=lib_path; lp && !win; lp=lp->next) {
- X+ if ((lp->length + name_size + 1) > size) {
- X+ size = lp->length + name_size + 1;
- X+ if (temp_name)
- X+ free (temp_name);
- X+ temp_name = 0;
- X+ }
- X+ if (!temp_name)
- X+ temp_name = (char *)xmalloc (size);
- X+ strcpy (temp_name, lp->path);
- X+ if (temp_name[lp->length - 1] != '/')
- X+ strcat (temp_name, "/");
- X+ strcat (temp_name, name);
- X+ win = islib(temp_name);
- X+ #ifdef DEBUG
- X+ fprintf (stderr, "%s: searching %s -> %d\n", progname, temp_name, win);
- X+ #endif
- X+ }
- X+ if (win)
- X+ return temp_name;
- X+ else {
- X+ free (temp_name);
- X+ return name;
- X+ }
- X+ }
- X+
- X+ char *
- X+ find_library (char *name)
- X+ {
- X+ char *temp_name;
- X+ char *lib_name;
- X+
- X+ temp_name = (char *)xmalloc (strlen (name) + 7); /* 6 chars for "Slib" and ".a" */
- X+ strcpy (temp_name, "lib");
- X+ strcat (temp_name, name);
- X+ strcat (temp_name, ".a");
- X+ if ((lib_name = find_library_1 (temp_name)) == temp_name) {
- X+ strcpy (temp_name, "Slib"); /* system libraries start with "Slib" */
- X+ strcat (temp_name, name);
- X+ strcat (temp_name, ".a");
- X+ lib_name = find_library_1 (temp_name);
- X+ }
- X+ free (temp_name);
- X+ #ifdef DEBUG
- X+ fprintf (stderr, "%s: library name is %s\n", progname, lib_name);
- X+ fprintf (stderr, "%s: returning %s\n", progname,
- X+ (lib_name == temp_name) ? name : lib_name);
- X+ #endif
- X+ return (lib_name == temp_name) ? name : lib_name;
- X+ }
- X+
- X+
- X+ char **argbuf; /* this holds the argument vector for ld */
- X+ int argbuf_index, argbuf_length;
- X+
- X+ /* Add one argument to the vector at the end. */
- X+
- X+ void
- X+ store_arg (char *arg)
- X+ {
- X+ if (argbuf_index + 1 == argbuf_length)
- X+ {
- X+ argbuf = (char **) xrealloc (argbuf, (argbuf_length*=2)*sizeof (char *));
- X+ }
- X+
- X+ argbuf[argbuf_index++] = arg;
- X+ argbuf[argbuf_index] = 0;
- X+ }
- X+
- X+ /*
- X+ * The standard Xenix ld is seriously braindamaged. It does not understand
- X+ * -llib options. So we expand them here and furthermore we process -Lpath
- X+ * options as used by the GNU tools.
- X+ */
- X+
- X+ int
- X+ main (int argc, char **argv)
- X+ {
- X+ int size;
- X+ char *lib_name;
- X+ #ifdef DEBUG
- X+ char **argp;
- X+ #endif
- X+
- X+ progname = *argv;
- X+
- X+ argbuf_length = 10;
- X+ argbuf_index = 0;
- X+ argbuf = (char **) xmalloc (argbuf_length * sizeof (char *));
- X+
- X+ /* push default library search paths on lib_stack */
- X+ lib_path = add_path (standard_startfile_prefix_2, (struct lib_path *)0);
- X+ lib_path = add_path (standard_startfile_prefix_1, lib_path);
- X+ lib_path = add_path (standard_startfile_prefix, lib_path);
- X+
- X+ /*
- X+ * Copy argv to argbuf processing -L switches and
- X+ * resolving library names. Preserve the order of the arguments.
- X+ */
- X+ store_arg ("ld"); /* provide argv[0] for ld */
- X+ for (++argv; --argc > 0; ++argv) {
- X+ if ((*argv)[0] == '-')
- X+ switch ((*argv)[1]) {
- X+ case 'L':
- X+ lib_path = add_path ((*argv)+2, lib_path);
- X+ break;
- X+ case 'l':
- X+ lib_name = find_library ((*argv)+2);
- X+ #ifdef DEBUG
- X+ fprintf (stderr, "%s: found library %s\n", progname, lib_name);
- X+ #endif
- X+ store_arg (lib_name);
- X+ break;
- X+ default:
- X+ store_arg (*argv);
- X+ }
- X+ else
- X+ /* just an input file */
- X+ store_arg (*argv);
- X+ }
- X+ #ifdef DEBUG
- X+ fprintf (stderr, "%s: linker call: \"", progname);
- X+ for (argp=argbuf; *argp; argp++)
- X+ fprintf (stderr, "%s ", *argp);
- X+ putc ('\n', stderr);
- X+ #endif
- X+ execv ("/bin/ld", argbuf);
- X+ /* maybe ld is not ld */
- X+ fprintf (stderr, "%s: unable to run /bin/ld", progname);
- X+ exit (1);
- X+ }
- X
- END_OF_FILE
- if test 41132 -ne `wc -c <'gcc-1.40.pch'`; then
- echo shar: \"'gcc-1.40.pch'\" unpacked with wrong size!
- fi
- # end of 'gcc-1.40.pch'
- fi
- echo shar: End of archive.
- exit 0
- --
- Steve.Bleazard@RoboBar.Co.Uk | Phone: +44 81 991 1142 x153
- Snr Software Engineer, Robobar Ltd. | Fax: +44 81 998 8343 (G3)
- 22 Wadsworth Road, Perivale. |
- Middx., UB6 7JD ENGLAND. | ...!ukc!robobar!steve
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-